fn main() {
    let s: String = String::from("hello");
    let s1: String = s.clone();
    takes_ownership(s);
    println!("smain{}", s1);

    let x = 5; // x 进入作用域

    makes_copy(x);
    println!("xmain{}", x);
    println!("返回值");
    my_return();
}
fn takes_ownership(s: String) {
    println!("s,{}", s)
}
fn makes_copy(some_integer: i32) {
    // some_integer 进入作用域
    println!("{}", some_integer);
}
fn my_return() {
    let s1 = gives_ownership();
    println!("s1{}", s1);
    let s2 = String::from("hello");
    println!("s2{}", s2);
    let s3 = takes_and_gives_back(s2);
    println!("s3{}", s3);
}
fn gives_ownership() -> String {
    let some_string = String::from("yours");
    some_string
}
fn takes_and_gives_back(a_string: String) -> String {
    a_string
}
